package cn.itsource.zcn.alipay.mapper;

import cn.itsource.zcn.alipay.domain.PayAlipayInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * (PayAlipayInfo)表数据库访问层
 *
 * @author makejava
 * @since 2021-08-28 21:55:56
 */
public interface PayAlipayInfoMapper {

    /**
     * 新增数据
     *
     * @param tPayAlipayInfo 实例对象
     */
    @Insert("insert into t_pay_alipay_info" +
            "(merchant_private_key,appid,alipay_public_key,shop_id,shopName)" +
            "values (#{merchant_private_key},#{appid},#{alipay_public_key},#{shop_id},#{shopName})")
    void save(PayAlipayInfo tPayAlipayInfo);

    /**
     * 修改数据
     *
     * @param tPayAlipayInfo 实例对象
     */
    @Update("update t_pay_alipay_info set " +
            "merchant_private_key=#{merchant_private_key},appid=#{appid},alipay_public_key=#{alipay_public_key},shop_id=#{shop_id},shopName=#{shopName} " +
            "where id = #{id}")
    void update(PayAlipayInfo tPayAlipayInfo);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     */
    @Delete("delete from t_pay_alipay_info where id = #{id} ")
    void delete(Long id);


    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Select("select * from t_pay_alipay_info where id = #{id}")
    PayAlipayInfo queryById(Long id);

    /**
     * 查询全部
     *
     * @return 对象列表
     */
    @Select("select * from t_pay_alipay_info")
    List<PayAlipayInfo> queryAll();

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<PayAlipayInfo> 实例对象列表
     */
    void insertBatch(@Param("PayAlipayInfos") List<PayAlipayInfo> entities);

    /**
     * 批量删除数据（MyBatis原生foreach方法）
     *
     * @param ids List<Integer> 实例对象列表
     */
    void deleteBatch(@Param("ids") List<Integer> ids);


}

